package com.gzy.cbrsystem.core;

import java.lang.reflect.Field;

public class Attribute {
	protected Field field;
	public Attribute(String name,Class sclass)
	{
		try {
			this.field=sclass.getField(name);
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
		}
	}
	public Object getValue(Object object)
	{
		Object res = null;
		try {
			res = this.field.get(object);
		} catch (IllegalArgumentException e) {
			
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			
			e.printStackTrace();
		}
		return res;
	}
}
